How to call function in layout DXL

I have function which calculates what to be displayed for each object in Column 2. I want to call this function in the layout dxl, below is the code to do that but unfortunately it does not work. While excecuting it halts showing error : incorrect arguments for function showObjectHistory()

string showObjectHistory(int objAbsNo)
{
........
}
void dxllayout()
{
string code = "pragma runLim,0\n" //-
"Buffer o = create()\n" //-
"o = showObjectHistory(obj.\"Absolute Number\")\n" //-
"displayRich (tempStringOf o)\n" //-
"delete(o)\n"

dxl(column traceColNo, code)
}

Pls let me know what is wrong?
DXLScripter - Thu Sep 20 08:12:53 EDT 2012

Re: How to call function in layout DXL
Mathias Mamsch - Thu Sep 20 09:28:23 EDT 2012

1. You are reading the Absolute Number incorrectly. To read the Absolute Number you need to explicitly use an assignment.
2. You need to put the code of showObjectHistory inside the dxl column code, because the dxl layout column won't know the code that created it.
3. You do not need single strings, DOORS supports multi line strings.
 

void dxllayout()
{
string code = "
Buffer getObjectHistory(int objAbsNo)
{
  Buffer result = create() 
 // ... add stuff to buffer, instead creating a string
}
 
pragma runLim,0
Buffer o = null
int nr = obj.\"Absolute Number\"
o = getObjectHistory(nr)
displayRich (tempStringOf o)
delete o
"
 
dxl(column traceColNo, code)

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS